package zzx;

import java.util.Scanner;

public class SalaryCalculate {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        Double rate;
        int t;
        Double s;
        t = sc.nextInt();
        if (t <= 3500)
            s = (double) t;
        else {
            t = t - 3500;
            if (t <= 1455) {
                rate = 1 - 0.03;
                s = t / rate;
            } else if (t <= 4155) {
                rate = 1 - 0.1;
                t = t - 1455;
                s = t / rate + 1500;
            } else if (t <= 7755) {
                rate = 1 - 0.2;
                t = t - 4155;
                s = t / rate + 4500;
            } else if (t <= 27255) {
                rate = 1 - 0.25;
                t = t - 7755;
                s = t / rate + 9000;
            } else if (t <= 41255) {
                rate = 1 - 0.3;
                t = t - 27255;
                s = t / rate + 35000;
            } else if (t <= 57505) {
                rate = 1 - 0.35;
                t = t - 41255;
                s = t / rate + 55000;
            } else {
                rate = 1 - 0.45;
                t = t - 57505;
                s = t / rate + 80000;
            }
            s = s + 3500;
        }
            Double s1 = new Double(s);
            int salary = s1.intValue();
            System.out.println(salary);
        }
}
